<template>
  <div class="new-p">
    <div class="you clearfix">
      <div class="fl">
        <div class="like-head"></div>
      </div>
      <div class="heart fl"></div>
      <div class="fl like-head-text" v-text="floor.gf_name"></div>
      <div class="fl">
        <div class="like-head"></div>
      </div>
    </div>
      <div class="clearfix you-like-content">
        <ul>
          <li class="fl transition-ease" @click.stop="toGoodsDetail(likelist.goodsId)" v-for="(likelist, index) in JSON.parse(floor.wide_goods)[0].goodsList" :key="index" :style="{ 'margin-right': `${(index+1) % 5 == 0 ? '0px' : '11px' }`}">
            <div class="like-img transition-ease img">
              <img v-lazy="likelist.img" >
            </div>
            <div class="like-text-footer">
              <div class="clearfix">
                <div class="fl like-payment" v-if="likelist.goodsPrice"><span>￥</span>{{likelist.goodsPrice}}</div>
                <div class="fr like-hot" ><span class="like-hots">已售{{likelist.goodsSalenum}}件</span></div>
              </div>
              <div class="like-text-foote-type" >
                <span>{{likelist.goodsNumType == 1 ? '现货' : '订货'}}</span>
              </div>
              <div class="like-text-foote-name" v-text="likelist.goodsName + ' ' + likelist.goodsSerial"></div>
            </div>
            <div class="like-text-bottom">
                <span class="shop-name">{{likelist.goodsStore}}</span>
                <span class="shop-address">{{likelist.shoppingAddr}}</span>
            </div>
          </li>
        </ul>
      </div>
  </div>
</template>

<script>
export default {
  props: {
    floor: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      wideGoods: {}
    }
  },
  mounted() {
    if (this.floor.wideGoodsList) {
      this.wideGoods = this.floor.wideGoodsList[0] || {}
    }
  },
  computed: {
    goodsList() {
      return this.wideGoods.goodsList || []
    }
  },
  methods: {
    /**
     * 跳转到商品详情页
     *
     * @param { Number } id 商品id
     */
    toGoodsDetail(id) {
      window.open('/goods/detail/' + id)
    }
  }
}
</script>

<style lang="scss" scoped>
</style>